1. Field of the Invention
Methods and apparatuses consistent with the present invention generally relate to video coding, and more particularly, to a method of and apparatus for estimating a motion vector based on the sizes of neighboring partitions, an encoder, a decoder, and a decoding method.
2. Description of the Related Art
Inter-frame and intra-frame predictions are main video encoding techniques. The intra-frame prediction uses a high correlation between gray levels of adjacent pixels in a single frame. The inter-frame prediction uses similarities between consecutive frames in a video sequence. As long as a sharp change does not occur in a moving picture, many parts of the moving picture change little between consecutive frames. In particular, motion-vector estimation is one of video encoding techniques used in the inter-frame prediction. The motion-vector estimation is designed to process an image by differentially encoding motion vectors obtained by motion estimation. Generally, a motion vector of a block has a close correlation with a motion vector of a neighboring partition. For this reason, the amount of bits to be encoded can be reduced by predicting a current block from the neighboring partition and encoding only a differential vector between the current block and a prediction block.
FIG. 1 illustrates neighboring partitions used for conventional motion estimation.
Referring to FIG. 1, a current macroblock E and its neighboring partitions A, B, and C are the same in shape and predictive encoding of a motion vector uses the median value of horizontal components and vertical components of motion vectors of a block A located to the left of the current block E, a block B located above the current block E, and a block C located above and to the right of the current block E. A skip macroblock mode is implemented in this way.
Direct mode prediction in H.264 is based on the assumption that there is a high spatial correlation in a video sequence. In other words, motion vectors of spatially adjacent blocks may have a high correlation therebetween, especially when they are included in the same object. Moving Picture Experts Group (MPEG)-4 uses a skip macroblock mode in which pixels that are located in the spatially same position as a macroblock, i.e., pixels having a motion vector of 0, are used as an encoded image without using information of the macroblock. Although a skip macroblock mode also exists in H.264, it uses a prediction signal, which is obtained by motion compensation using a motion vector predictor, as an encoded signal without meaning “motion vector of 0”. In other words, since a motion vector can be accurately estimated using a neighboring partition in an image having a unidirectional motion according to H.264, encoding efficiency can be improved when compared to MPEG-4 that uses “motion vector of 0”. Thus, the skip macroblock mode is selected mainly for a background object. A spatial direct mode is also used in a similar manner to the skip macroblock mode.
According to H.264, when a motion vector of a neighbor partition (block A or B in FIG. 1) is 0, a motion vector of the current block E is also estimated as 0 on the assumption that the current block E has a similar motion as in the case with the neighboring partition. However, this assumption does not match not only in a case where the current block and its neighbor partition are included in the same object, e.g., a background object, but also in a case where they are included in different objects.